using UnityEngine;

public class Cargo : MonoBehaviour
{
    public float size;
    private bool isFalling = false;

    private float g = -9.8f;
    private float v = 0;
    private void Update()
    {
        if (isFalling)
        {
            v += g * Time.deltaTime;
            transform.Translate(0, v * Time.deltaTime, 0);
            if (transform.position.y < -10f) Destroy(gameObject);
        }
    }

    public void SetFalling () { isFalling = true; }
}